package tingshu.view_object;

import tingshu.data_object.AlbumDO;
import tingshu.data_object.TrackDO;

import java.util.ArrayList;
import java.util.List;

/**
 * @author houdaiqin
 * @date 2022/07/17 15:03
 **/
public class BindView {
    public static class TrackView{
        public Integer tid;
        public String title;

        public TrackView(Integer tid, String title) {
            this.tid = tid;
            this.title = title;
        }
    }
    public UserVO currentUser;
    public Integer aid;
    public String title;
    public List<TrackView> trackList;

    public BindView(UserVO currentUser, AlbumDO albumDO, List<TrackDO> trackDOList){
        this.currentUser=currentUser;
        this.aid=albumDO.aid;
        this.title=albumDO.title;

        this.trackList=new ArrayList<>();
        for(TrackDO trackDO:trackDOList){
            TrackView trackView=new TrackView(trackDO.tid,trackDO.title);
            trackList.add(trackView);
        }
    }
}